# -*- coding: utf-8 -*-
from os import write
import requests
url = 'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=38785274,1357847304&fm=26&gp=0.jpg'
#简单定义浏览器ua信息
headers = {
    "User-Agent":"Mozilla/4.0"
}
#读取图片需要使用content属性
html = requests.get(url=url,headers=headers).content
#以二进制的方式下载图片
with open('D:\\WorkSpace\\Ptyhon3\\xg-spider\\src\\image\\python_logo.jpg', 'wb') as f:
    f.write(html)